import 'package:flutter_test/flutter_test.dart';
import 'package:ceshi_plugin/ceshi_plugin.dart';
import 'package:ceshi_plugin/ceshi_plugin_platform_interface.dart';
import 'package:ceshi_plugin/ceshi_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockCeshiPluginPlatform 
    with MockPlatformInterfaceMixin
    implements CeshiPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final CeshiPluginPlatform initialPlatform = CeshiPluginPlatform.instance;

  test('$MethodChannelCeshiPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelCeshiPlugin>());
  });

  test('getPlatformVersion', () async {
    CeshiPlugin ceshiPlugin = CeshiPlugin();
    MockCeshiPluginPlatform fakePlatform = MockCeshiPluginPlatform();
    CeshiPluginPlatform.instance = fakePlatform;
  
    expect(await ceshiPlugin.getPlatformVersion(), '42');
  });
}
